<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<script>
$(function(){
	$("#fundFlowIndexSelectId").val("${viewRequest.params['_and_f_dot_type_eq_number']}");
	
});

</script>
<form id="pagerForm" method="get" model="viewRequest" action="#rel#">
	<input type="hidden" name="viewRequest.page" value="${page.number}" />
	<input type="hidden" name="viewRequest.size" value="${page.size}" />
	<c:forEach items="${viewRequest.params}" var="params">
		<input type="hidden" id="${params.key}" name="viewRequest.params['${params.key}']" value="${params.value}" />
	</c:forEach>
	<c:forEach items="${viewRequest.sort}" var="sort">
		<input type="hidden" name="viewRequest.sort.${sort.key}" value="${sort.value}" />
	</c:forEach>
</form>

<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="${rootUrl}/member/fund-flow" method="get">
	<div class="searchBar">
		<ul class="searchContent">
			<li style="width: 250px">
				<label>会员名：</label>
				<input type="text" name="viewRequest.params['_and_m_dot_loginname_like']" value="${viewRequest.params['_and_m_dot_loginname_like']}"/>
			</li>
			<li style="width: 250px">
				<label>交易类型：</label>
				<select name="viewRequest.params['_and_f_dot_type_eq_number']" id="fundFlowIndexSelectId">
					<option value="">全部</option>
					<c:forEach items="${fundFlowType }" var="fft">
						<option value="${fft.key }">${fft.value }</option>
					</c:forEach>
				</select>
			</li>
			<li style="width: 250px">
				<label>订单编号：</label>
				<input type="text" name="viewRequest.params['_and_f_dot_code_like']" value="${viewRequest.params['_and_f_dot_code_like']}"/>
			</li>
			<li style="width: 400px">
				<label>交易金额(元)：</label>
				<c:if test="${not empty viewRequest.params['_and_f_dot_money_ge_number']}">
				<input type="text" name="viewRequest.params['_and_f_dot_money_ge_number']" value="${viewRequest.params['_and_f_dot_money_ge_number']/100}" />
				</c:if>
				<c:if test="${empty viewRequest.params['_and_f_dot_money_ge_number']}">
				<input type="text" name="viewRequest.params['_and_f_dot_money_ge_number']" placeholder="起始金额"/>
				</c:if>
				
				<c:if test="${not empty viewRequest.params['_and_f_dot_money_le_number'] }">
				<input type="text" name="viewRequest.params['_and_f_dot_money_le_number']" value="${viewRequest.params['_and_f_dot_money_le_number']/100}" />
				</c:if>
				<c:if test="${empty viewRequest.params['_and_f_dot_money_le_number'] }">
				<input type="text" name="viewRequest.params['_and_f_dot_money_le_number']" placeholder="结束金额"/>
				</c:if>
			</li>
			<li style="width: 500px">
				<label>交易时间：</label>
				<input name="viewRequest.params['_and_f_dot_createdAt_ge_date']" type="text" class="date" size="20" value="${viewRequest.params['_and_f_dot_createdAt_ge_date'] }" placeholder="开始时间"/>
				<input name="viewRequest.params['_and_f_dot_createdAt_le_date']" type="text" class="date" size="20" value="${viewRequest.params['_and_f_dot_createdAt_le_date'] }" placeholder="结束时间"/>
			</li>
		</ul>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
			</ul>
		</div>
	</div>
	</form>
</div>
<div class="pageContent">
	<table class="table" targetType="dialog"  width="100%" layoutH="110">
		<thead>
			<tr>
				<th width="50" align="center" >序号</th>
				<th width="300" align="center" >会员名</th>
				<th width="300" align="center" >交易类型</th>
				<th width="300" align="center" >订单编码</th>
				<th width="100"  >交易金额(元)</th>
				<th align="center" >备注</th>
				<th width="100" align="center" >资金来源</th>
				<th width="300" align="center" >交易时间</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.content}" var="fundFlow" varStatus="status">
				<td>${status.count}</td>
				<td>${fundFlow.member.loginname}</td>
				<td>
					${fundFlowType[fundFlow.type]}
				</td>
				<td>${fundFlow.code}</td>
				
				<c:if test="${fundFlow.type == 50 || fundFlow.type == 51 || fundFlow.type == 60 || fundFlow.type == 61}">
				<td class="listMoneyField">${fundFlow.money}</td>
				</c:if>
				<c:if test="${fundFlow.type != 50 && fundFlow.type != 51 && fundFlow.type != 60 && fundFlow.type != 61}">
				<td class="listMoneyField"><fmt:formatNumber value="${fundFlow.signed}${fundFlow.money/100}" pattern="0.00"/></td>
				</c:if>
				
				<td>${fundFlow.remark}</td>
				<td>${fundFlow.fromMember.loginname}</td>
				<td><fmt:formatDate value="${fundFlow.createdAt}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
				<option value="${page.size}">${page.size}</option>
				<option value="20">20</option>
				<option value="50">50</option>
				<option value="100">100</option>
				<option value="200">200</option>
			</select>
			<span>条，共${page.totalElements}条 </span>
		</div>
		<div class="pagination" targetType="navTab" totalCount="${page.totalElements}" numPerPage="${page.size}" pageNumShown="10" currentPage="${page.number}"></div>
	</div>
</div>